// dlg.txt

begintalkscript;

variables;

begintalknode 1;
	state = -1;
	nextstate = -1;
	condition = get_sdf(48,4) == 0;
	question = "special";
	text1 = "You enter Fort Vengeance, middle fort in the line that is keeping the rebels out of the Storm Plains. There is a lot of activity. Serviles rebuilding destroyed buildings, soldiers training, savage creations waiting for battle.";
	text2 = "You don't feel that you are receiving a warm welcome. In fact, the guards watch every move you make very nervously. None of them stop you, though. You aren't a Shaper, but they seem to think you are.";
	text3 = "You don't feel that you are receiving a warm welcome. In fact, the guards watch every move you make very nervously. Exactly how you would expect they'd treat a free servile. None of them stop you, though.";
	text4 = "The eastern wall of the fort is enormous. It is a thick bulwark of granite blocks, topped with vicious, rusty iron spikes. It looks very old. The Shapers only needed to clean it up and sharpen the spikes.";
	text5 = "On the other side of the wall, you can hear the howls of angry rogues. They come as close as they can to Shaper territory without getting blasted.";
	action = SET_SDF 48 4 1;
	code =
		if (creature_type(pc_num()) != 46) 
			rs(3);
			else rs(2);
	break;
	
begintalknode 2;
	state = -1;
	nextstate = -1;
	condition = get_sdf(48,5) == 0;
	question = "special";
	text1 = "You look out at the fields east of Fort Vengeance. The rebels and the Shapers have fought back and forth over this miserable patch of land for years now. It bears the scars and wreckage of their struggles.";
	text2 = "Several rogues wander freely around the field, keeping a safe distance from the fort. They look hungry and savage. Your amulet is unlikely to convince them to let you alone.";
	action = SET_SDF 48 5 1;
	code =
		sf(48,14,1);
		if (has_spec_item(2) == 0)
			rs(2);
	break;
	
begintalknode 3;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "__";

begintalknode 4;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "__";

begintalknode 5;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "You speak with one of Fort Vengeance's inadequate number of human soldiers. They say, with some resentment, how the Guardian does not allow them to speak with visitors. The conversation doesn't last very long.";

begintalknode 6;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "There are a number of creations chained up or patrolling around Fort Vengeance, ready to be sent out to battle other creations sent by the rebels. This carnage continues on a daily basis.";	
	text2 = "If they mind the pointlessness of their lives (and deaths), they show no sign of it.";
	text3 = "They are, however, not in perfect control. Their creators have been away for a while. If nobody comes back to maintain them soon, they might go rogue.";

begintalknode 7;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "This is a construction servile, carrying around supplies and dedicated to completing the reconstruction of this fort. You try to start a conversation, but the servile walks by quickly, eyes cast to the ground.";
	text2 = "They must have instructions not to talk to outsiders. Or they're wise enough to not do anything that might be interpreted as disloyalty.";

begintalknode 8;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "These three creations have been back here for weeks, wet, cold, and forgotten. Their control has been allowed to become dangerously weak.";
	text2 = "You pat them and calm them down. Your aura of command is strong enough to pacify them. They will be all right for a few more weeks.";
	text3 = "You try to slip past them quietly, but they are too agitated. They go rogue before you can slip by. You wonder how often incidents like this are happening in Shaper forts across Terrestia ...";
	code =
		if (get_stat(20) >= 6) {
			rs(3);
			award_party_xp(150,18);
			}
			else {
				rs(2);
				set_attitude(53,10);
				set_attitude(54,10);
				set_attitude(55,10);
				}
	break;
	
// tima

begintalknode 10;
	state = -1;
	nextstate = 10;
	condition = 1;
	question = "Tima";
	text1 = "You see one of the serviles who is working on constructing new buildings for the fort. She is carrying a large armload of tools.";
	text2 = "Something sets her apart from the other serviles. One subtle detail. The others are constantly looking down at the ground. This servile quickly flicks her eyes to meet your gaze.";
	text3 = "Then, realizing that you are looking at her, she quickly says, _Sorry. Traveler. I ... I am Tima. I go now. Go work._";
	text5 = "Tima is still carrying tools back and forth. This time, she remembers to keep staring at the ground.";
	action = INTRO;

begintalknode 11;
	state = 10;
	nextstate = 11;
	condition = gf(48,1) == 0;
	question = "Wait, servile. I want to talk to you.";
	text1 = "She freezes in place. She almost drops a hammer, but she manages to save it at the last moment. _Sorry, Shaper. Shaper? You Shaper? I ... I no talk good. Work. Just work._";

begintalknode 12;
	state = 10;
	nextstate = -1;
	condition = gf(48,1) == 0;
	question = "(Let her go.)";
	text1 = "Relieved, she walks away quickly.";
	action = END_TALK;

begintalknode 13;
	state = 11;
	nextstate = -1;
	condition = 1;
	question = "What are you working on?";
	text1 = "_Just build. Make buildings. For Shapers. That all I do._";

begintalknode 14;
	state = 11;
	nextstate = -1;
	condition = get_stat(20) < 5;
	question = "You seem different from the other serviles.";
	text1 = "She quivers nervously, but you aren't able to bring her out. _I ... I don't know. No understand. Just servile. Just build._";

begintalknode 15;
	state = 11;
	nextstate = 12;
	condition = get_stat(20) >= 5;
	question = "You seem smarter than the other serviles. Pity you are stuck here.";
	text1 = "Something about your voice makes her believe you. She looks up into your eyes. _I ... Nobody ever say that before._ She looks around to make sure nobody is eavesdropping.";
	text2 = "_I no like this._ She holds up the tools. _Want to go do ... New things. Smart things._";

begintalknode 16;
	state = 11;
	nextstate = -1;
	condition = 1;
	question = "Never mind.";
	text1 = "She nods. _Goodbye. I go work now._ She walks off quickly.";
	action = END_TALK;

begintalknode 17;
	state = 12;
	nextstate = -1;
	condition = 1;
	question = "Have you heard of the Shadow Road?";
	text1 = "She sighs. _All hear of Shadow Road. All serviles. It far away. Over mountains. Need guide. Nobody can show me._ She looks up at you. You shake your head. You don't have time to escort lost serviles all over Terrestia.";
	text2 = "_I stay here. Is safe, at least. For now._";

begintalknode 18;
	state = 12;
	nextstate = -1;
	condition = gf(41,12) == 1;
	question = "I have met a servile who helps escort other serviles to the Shadow Road. Should I tell her about you?";
	text1 = "Tima's mouth falls open. She is too stunned to speak. Finally, she manages to nod.";
	text2 = "Then, terrified of being caught in her moment of disloyalty, she clutches the tools to her chest and walks off.";
	action = END_TALK;
	code =
		sf(48,1,1);
	break;
	
begintalknode 19;
	state = 12;
	nextstate = -1;
	condition = 1;
	question = "You should accept your place. The Shaper way is hard to understand, but it works.";
	text1 = "She nods, but she isn't convinced. _I ... That is what all serviles say. We trust the Shapers. But ... I will obey._";
	text2 = "She walks off with her tools, a bit slower than before.";
	action = END_TALK;
	
begintalknode 20;
	state = 12;
	nextstate = -1;
	condition = 1;
	question = "I'm sorry. I can't help you.";
	text1 = "She nods. _Just please ... Don't say what I say. I am loyal. Do not get me hurt. I go._";
	text2 = "She walks off.";
	action = END_TALK;

begintalknode 21;
	state = 10;
	nextstate = -1;
	condition = gf(48,1) > 0;
	question = "I want to talk to you.";
	text1 = "She shakes her head. _After what I say ... I break law. No more talk. Not safe. I say what I want. I go._ She walks off.";
	action = END_TALK;

	
//

begintalknode 30;
	state = -1;
	nextstate = 30;
	condition = 1;
	question = "Cyprien";
	text1 = "This is a well-equipped Shaping workshop, kept clean, properly stocked, and ready for Shapers to be able to move in and make a host of new creations at a moment's notice.";
	text2 = "Right now, however, it is maintained by one woman. She is middle-aged and wears mage's robes. Her face is marked by the wrinkles that come from a lot of frowning.";
	text3 = "When she sees you, her expression softens. _Ah. Not a Shaper. A lowly outsider, like me. I am Cyprien. Mage in residence for Fort Vengeance. How can I help you?_";
	text5 = "Cyprien wanders around the laboratory, getting a little work done. She makes the occasional potion. She waits for attackers. Sometimes, she sweeps. Her resentment is palpable.";
	action = INTRO;

begintalknode 31;
	state = 30;
	nextstate = 31;
	condition = 1;
	question = "What do you do here?";
	text1 = "She looks around the laboratory with distaste. _I keep this place ready for the Shapers. When they come here, they want to do their work quickly and go._";
	text2 = "_And I help to defend the fort from attackers. Of course._";

begintalknode 32;
	state = 30;
	nextstate = 32;
	condition = 1;
	question = "You are a mage for the Shapers?";
	text1 = "She laughs. _All mages are mages for the Shapers. We do what they say, research what they allow, cast only spells that are specifically allowed in their ledgers._";

begintalknode 33;
	state = 30;
	nextstate = -1;
	condition = has_spec_item(2) == 0;
	question = "Can you give me training?";
	text1 = "Cyprien shakes her head. _Whatever the wisdom of the Shaper laws about magic, I will not be punished for disobeying them. I can only share magic with those who work for General Alwan._";
	text2 = "";

begintalknode 34;
	state = 30;
	nextstate = 35;
	condition = has_spec_item(2) > 0;
	question = "Can you give me training?";
	text1 = "You show her the amulet Alwan gave you to prove that you work for him. _There are certain lesser rituals I can teach to any who serve Alwan. If you are interested._";

begintalknode 35;
	state = 30;
	nextstate = 37;
	condition = gf(42,20) == 1 && gf(48,2) == 0;
	question = "I have a message from Stormhold. (Give it.)";
	text1 = "Cyprien takes the message, opens it up, and reads it. Then she tears it up and throws it into a brazier. She is plainly upset.";
	code =
		sf(48,2,1);
	break;

begintalknode 36;
	state = 31;
	nextstate = -1;
	condition = 1;
	question = "How often do Shapers visit?";
	text1 = "_Guardian Genzlen is stationed here. Others travel around. There aren't enough Shapers to go around, so they travel, they make their creations, they move on, and they try to come back before the creations they leave go rogue._";
	text2 = "_And, when they come here, they expect everything to be ready for them. Maintained by servants like me._";

begintalknode 37;
	state = 31;
	nextstate = -1;
	condition = 1;
	question = "You help fight the rebels?";
	text1 = "_Magical support is vital in battles of all sizes. My blessings and missiles have been used to fend off a number of assaults since General Alwan took the line._";
	text2 = "_The scraps of magic the Shapers allow me have all been used to kill their enemies._";

begintalknode 38;
	state = 32;
	nextstate = -1;
	condition = 1;
	question = "Did you ever try to become a Shaper?";
	text1 = "She smiles wryly. _It was never an option._ She doesn't elaborate.";

begintalknode 39;
	state = 32;
	nextstate = -1;
	condition = 1;
	question = "What would you do if you could?";
	text1 = "_I flatter myself by thinking that I have some talent. I could achieve much, I think. If I was allowed. But the Shapers have a problem with my ... temperament._";

begintalknode 40;
	state = 32;
	nextstate = 33;
	condition = 1;
	question = "You don't agree with Shaper law?";
	text1 = "_Oh! Shaper law! Heavens, I would never say anything against Shaper law! That which sustains us all._";
	text2 = "_But since you are busy looking for sedition, what do you think of the Shaper laws about magic?_";
	code = 
		if (gf(48,9) > 0)
			rs(2);
	break;
	
begintalknode 41; // pro shaper
	state = 33;
	nextstate = -1;
	condition = get_flag(48,9) == 0;
	question = "I agree with them. Without close supervision, magical powers could be used for horrible ends.";
	text1 = "She looks down at the floor. _I am forced to agree with you. I lack the courage to disagree with any force. Whatever I believe, I will be a loyalist until I die._";	
	action = SET_SDF 48 9 1;
	code = 
		inc_flag(100,0,2);
	break;

begintalknode 42; // anti shaper
	state = 33;
	nextstate = -1;
	condition = get_flag(48,9) == 0;
	question = "I think that's just an excuse Shapers use to hoard power for themselves.";
	text1 = "Her face betrays no response to your words. _You are brave to say it. A courage I lack. In the end, I will be angry, and I will obey. Whatever I believe, I will be a loyalist until I die._";
	action = SET_SDF 48 9 1;
	code = 
		inc_flag(100,0,-2);
	break;

begintalknode 43;
	state = 35;
	nextstate = 30;
	condition = 1;
	question = "I want to learn magic.";
	text1 = "You conclude your training.";	
	code = 
		begin_shop_mode("Cyprien",
		  "Cyprien is specifically authorized to share a limited number of magical spells with you.",
		  50,4,0);	
	break;
	
begintalknode 44;
	state = 35;
	nextstate = 30;
	condition = 1;
	question = "I want to discuss something else.";
	text1 = "_Go on._";

begintalknode 45;
	state = 37;
	nextstate = -1;
	condition = 1;
	question = "What was the message?";
	text1 = "_Another refusal. Another set of limits. I could be one of the best mages in the Storm Plains, but the Shapers, they ... My temper. My attitude. My inability to snivel on cue. So I am never allowed to learn._";
	text2 = "_I must cast the same pitiful spells, mop their floors while they ... Excuse me. I need a moment to compose myself._ She places a hand over her eyes and turns away.";
	action = END_TALK;

// Guardian Genzlen

begintalknode 50;
	state = -1;
	nextstate = 50;
	condition = 1;
	question = "Name";
	text1 = "You meet the commander of Fort Vengeance, a Guardian. A surprisingly young Guardian. Newly-minted Shapers usually spend years in the large western cities honing their skills before they are sent out into the wilds.";
	text2 = "The Shapers may have been taking heavy losses. Their numbers are thin. Still, although this Guardian is young, he has already gained the unshakable confidence of his kind. He looks you over, not liking what he sees.";
	text3 = "_I am Guardian Genzlen, commander of Fort Vengeance. We do not welcome merchants or refugees here. If you have official business from General Alwan, you may remain. Otherwise, you will have to go._";
	text5 = "Guardian Genzlen shuffles around the papers on his desk and plans the creation creation schedule for the next few weeks. He occasionally gives you the absolute minimum acknowledgment polite society requires.";
	action = INTRO;

begintalknode 51;
	state = 50;
	nextstate = -1;
	condition = gf(48,10) == 0 && has_spec_item(2) == 0;
	question = "I have papers from a member of the Council. (Show Rawal's papers.)";
	text1 = "He looks at them long enough to see the signature on the bottom, and then he hands them back. _These are from Shaper Rawal, not General Alwan. Not what I need._";
	text2 = "_Please leave now. We don't want to have to escort you out._ And that ends the conversation.";
	action = END_TALK;
	
begintalknode 52;
	state = 50;
	nextstate = -1;
	condition = gf(48,10) == 0 && has_spec_item(2) > 0;
	question = "I am on a mission for Alwan. (Show the amulet he gave you.)";
	text1 = "Guardian Genzlen looks closely at the amulet. Then he nods regretfully. _This is the amulet that was described. I was told you would be coming. I did not think you would be so questionable._";
	text2 = "_I will have the eastern gate unlocked for you. You may cross the wastes. Though I would not rely too heavily on that trinket._";
	code =
		sf(48,10,1);
		sf(48,14,1);
	break;
	
begintalknode 53;
	state = 50;
	nextstate = 51;
	condition = gf(48,10) > 0;
	question = "How long have you been stationed here?";
	text1 = "_Only a few months. My skill in training resulted in my receiving a command here, in a fortress of the line. Very unusual. A rare honor._";
	
begintalknode 54;
	state = 50;
	nextstate = 54;
	condition = gf(48,10) > 0;
	question = "What can you tell me about the wastes?";
	text1 = "_That I am glad that you are crossing them and not me. If the rumors I have heard about the amulet are true, you may be safe. And yet, few things in this world work as planned._";
	
begintalknode 55;
	state = 50;
	nextstate = 57;
	condition = gf(48,10) > 0;
	question = "Have you been attacked recently?";
	text1 = "_Of course. The enemy makes a pack of creations and sends them at us. We send out our own creations to fight them. They kill each other. It's how we test each other, practically every day._";
	text2 = "_It was worse before General Alwan built the line. Before, the rebels had put holes in the walls. They slipped through several times. That is how Hatra was destroyed._";
	
begintalknode 56;
	state = 51;
	nextstate = -1;
	condition = 1;
	question = "The line?";
	text1 = "_That is what we call the three keeps of these mountains, the line past which the rebels will never again cross._";
	
begintalknode 57;
	state = 51;
	nextstate = -1;
	condition = 1;
	question = "What happened to your predecessor?";
	text1 = "_He was a skilled Shaper, who suffered an unfortunate ambush. I think he will be able to recover from his wounds and rejoin the fight. Eventually._";
	
begintalknode 58;
	state = 51;
	nextstate = -1;
	condition = 1;
	question = "Why is it so unusual for you to be here?";
	text1 = "You are treading very close to bringing up Genzlen's tender age and the increasing lack of surviving Shapers. He decides that he has had enough of this topic. _We do not discuss Shaper matters with outsiders._";
	text2 = "_What else do you need?_";

begintalknode 59;
	state = 54;
	nextstate = -1;
	condition = 1;
	question = "What have you heard about the amulet?";
	text1 = "_That it was a Shaper symbol, to protect its couriers from our creations. But the drakons took it from the corpse of a murdered Shaper and changed it. And then sent it to you._";
	text2 = "_Perhaps it will convince all the fighting creations in the wastes to ignore you. Or not._";

begintalknode 60;
	state = 54;
	nextstate = 55;
	condition = 1;
	question = "Why don't you think it will work?";
	text1 = "_Because it is a symbol. The creations are supposed to see it and know not to attack you. But that depends on the rogues being disciplined and properly instructed. Unlikely, in the madness of the wastes._";

begintalknode 61;
	state = 55;
	nextstate = -1;
	condition = 1;
	question = "So what would you recommend?";
	text1 = "_Stay close to the roads. That is where the newest, freshest creations patrol. The farther from the road, the more likely they are to be rogue._";

begintalknode 62;
	state = 50;
	nextstate = -1;
	condition = gf(48,10) > 0;
	question = "Can I receive training?";
	text1 = "He reacts to this suggestion with extreme distaste. _To share the secrets of the Shapers with an outsider? Others may have sunk so low. Not me. If you want to learn some magic, talk to Cyprien._";

begintalknode 63;
	state = 57;
	nextstate = -1;
	condition = 1;
	question = "They don't slip through anymore?";
	text1 = "_Not a one. To get through, they will have to kill every warrior and creation in here. Those are Alwan's orders._";
	text2 = "";

begintalknode 64;
	state = 57;
	nextstate = -1;
	condition = gf(48,11) < 2;
	question = "Tell me about Hatra.";
	text1 = "_It is still a wreck, and there are rogues hidden in the ruins. We have only had the forces to watch and guard the east, so we haven't been able to send anyone west to flush them out._";
	text2 = "_I tried offering a bounty to anyone who can slay fifteen glaahks in the ruins. Still no luck._";
	code = 
		set_flag(48,11,1);
		toggle_quest(83,1);
	break;
	
begintalknode 65;
	state = 50;
	nextstate = -1;
	condition = gf(48,11) == 1 && gf(39,7) >= 15;
	question = "I have killed fifteen glaahks in Hatra.";
	text1 = "General Genzlen is surprised. _I'd given up hope of anyone collecting that bounty. I'm glad I still have the money. Most of it, anyway._";
	text2 = "He has a soldier bring you a sack. It contains a cash payment and a worn leather girdle with a silver buckle.";
	code = 
		set_flag(48,11,2);
		toggle_quest(83,3);
		award_party_xp(200,25);
		reward_give(173);
		change_coins(250);
	break;	
	
begintalknode 66;
	state = 50;
	nextstate = -1;
	condition = gf(48,1) > 0 && gf(48,7) == 0 && gf(48,8) == 0;
	question = "I think one of your serviles is going rogue. Her name is Tima.";
	text1 = "_Tima? I don't keep track of the individual serviles. However, I'll make sure that one of my soldiers quarantines her before she spreads her treachery to the others._";
	text2 = "_Thank you for the information. I will make a note of your loyalty._";
	code =
		erase_char(8);
		inc_flag(100,0,2);
		sf(48,7,1);
		sf(48,1,0);
	break;
	
begintalknode 67;
	state = 50;
	nextstate = -1;
	condition = gf(100,15) > 1;
	question = "Any other changes lately?";
	text1 = "He looks down at his maps and notes in despair. _Only the fall of Fort Rockfall. Of losing our flank and the prospect of rebel raids from both directions. We are not prepared._";
	text2 = "_I wish I knew who was responsible for that loss. I would strangle ... With my own two hands ... Please leave me. I need to plan._";
	action = END_TALK;
	
begintalknode 68;
	state = 50;
	nextstate = 60;
	condition = gf(46,7) > 0 && gf(48,10) > 0 && gf(48,3) != 1 && gf(46,5) == 0;
	question = "I have found hints that there is illegal Shaping going on nearby.";
	text1 = "_Really? Excellent. I am always eager to purge those who thwart our laws. Things became too lax before the rise of Alwan. Who shall I order you to kill?_";

begintalknode 69;
	state = 60;
	nextstate = -1;
	condition = 1;
	question = "Actually, now that I think about it, there is nothing out there to worry about.";
	text1 = "_What? Really? This is most suspicious. If you ever learn something, come back. Otherwise, do not waste my time._";
	action = END_TALK;
	code =
		sf(48,3,2);
	break;

begintalknode 70;
	state = 60;
	nextstate = -1;
	condition = 1;
	question = "It is Sage Olipha.";
	text1 = "You describe what you saw. Genzlen is not surprised. _That hermit? I have had my suspicions. You have my permission to sack his home. Take what you find. Destroy the traitor. Report back to me when it is done._";
	action = END_TALK;
	code =
		inc_flag(100,0,2);
		sf(48,3,1);
	break;
		

begintalknode 71;
	state = 50;
	nextstate = -1;
	condition = gf(48,3) == 1 && gf(46,5) > 0;
	question = "Sage Olipha is dead.";
	text1 = "_I appreciate your help. You are a credit to the Shapers. And we reward those who are loyal._ The Guardian gives you a wooden baton. _A nice little item. Not as useful for defense but excellent for fast, efficient raids._";
	code =
		sf(48,3,3);
		reward_give(240);
		award_party_xp(150,25);
	break;

begintalknode 75;
	state = 50;
	nextstate = -1;
	condition = gf(48,10) > 0;
	question = "That is all I need.";
	text1 = "He nods and returns to work, waving you away.";
	action = END_TALK;	


//

begintalknode 90;
	state = -1;
	nextstate = 90;
	condition = 1;
	question = "Name";
	text1 = ".";
	text2 = "";
	text5 = ".";
	action = INTRO;

begintalknode 91;
	state = 90;
	nextstate = -1;
	condition = 1;
	question = "";
	text1 = ".";
	text2 = "";
		